if __name__ == '__main__':
    headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0",
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
    "Accept-Language": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2",
    "Accept-Encoding": "gzip, deflate, br",
    "Connection": "keep-alive",
    "Upgrade-Insecure-Requests": "1",
    "Sec-Fetch-Dest": "iframe",
    "Sec-Fetch-Mode": "navigate",
    "Sec-Fetch-Site": "same-site"
    }
import requests
import time
import base64
# req = requests.get("https://splcgk.court.gov.cn/gzfwww//ktgglist?pageNo=2", headers = headers)
# for i in req.json().get('data'):
#     b  = base64.b64encode(str(i).encode())
#     print(b)
#     j = base64.b64decode(b.decode())
#     print(j)

#     print(j.decode())
#     time.sleep(20)

# resu = requests.get('https://fanyi-cdn.cdn.bcebos.com/static/cat/asset/logo.2481f256.png')
with open('1.jpg','rb')as f:
    code = base64.b64encode(f.read())
    
    with open('6.jpg','wb')as f:
        print(base64.b64decode(code))
        f.write(base64.b64decode(code))